package com.pvj.myaccount.repository

import com.pvj.myaccount.room.DbHelper
import com.pvj.myaccount.room.entity.MonthCost

class MonthCostRepository {

    suspend fun getAll(): List<MonthCost>? {
        // 异步获取数据
        return DbHelper.INSTANCE?.monthCostDao()?.getAllAsync()
    }

    fun insert(monthCost:MonthCost)  {
        // 异步获取数据
         DbHelper.INSTANCE?.monthCostDao()?.insert(monthCost)
    }

    fun delete(monthCost:MonthCost)  {
        // 异步获取数据
        DbHelper.INSTANCE?.monthCostDao()?.delete(monthCost)
    }

    fun update(monthCost:MonthCost)  {
        // 异步获取数据
        DbHelper.INSTANCE?.monthCostDao()?.update(monthCost)
    }
}